<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>层级选择器演示</title>

    <style>
        .div1 {
            width: 100px;
            height: 100px;
            background: red;
        }

        /* 层级选择器 */
        .div1 div {
            width: 50px;
            height: 50px;
            background: yellow;
        }

        .div1 .div3 {
            width: 50px;
            height: 50px;
            background: purple;
        }

        .div1 p {
            color: green  
        }
    </style>
</head>
<body>
    <div class="div1">
        <div>
            嘻嘻
        </div>
        <div class="div3">
            嘻嘻
        </div>
        <div>
            <p>我是一个段落</p>
        </div>
    </div>
</body>
</html>